﻿
using System.Data;
using System.Data.Common;
using System.Collections.Generic;

using RMS.DataAccess;
using RMS.DataAccess.Common;
using RMS.DataAccess.Entities;
namespace RMS.DataAccess.Repositories
{	
	#region [ ContractsRepository ]
	/// <summary>
	/// Repository for CRUD operations on Contracts table 
	/// </summary>
	public class ContractsRepository : RepositoryBase< Contracts,System.Int32,ContractsColumns >
	{
	 public ContractsRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(Contracts entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("CompanyName",entity.CompanyName);
								yield return CreateParameter("ContracrtDate",entity.ContracrtDate);
								yield return CreateParameter("FromDate",entity.FromDate);
								yield return CreateParameter("ToDate",entity.ToDate);
								yield return CreateParameter("MaxLimit",entity.MaxLimit);
								yield return CreateParameter("Precentage",entity.Precentage);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(Contracts entity)
		{
							yield return CreateParameter("ContractId",entity.ContractId);
							yield return CreateParameter("CompanyName",entity.CompanyName);
							yield return CreateParameter("ContracrtDate",entity.ContracrtDate);
							yield return CreateParameter("FromDate",entity.FromDate);
							yield return CreateParameter("ToDate",entity.ToDate);
							yield return CreateParameter("MaxLimit",entity.MaxLimit);
							yield return CreateParameter("Precentage",entity.Precentage);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("ContractId",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_Contracts_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_Contracts_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_Contracts_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_Contracts_Select";}
		}
		}
		#endregion
	
	#region [ PatientOrganesRepository ]
	/// <summary>
	/// Repository for CRUD operations on PatientOrganes table 
	/// </summary>
	public class PatientOrganesRepository : RepositoryBase< PatientOrganes,System.Int32,PatientOrganesColumns >
	{
	 public PatientOrganesRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(PatientOrganes entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("OrganesName",entity.OrganesName);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(PatientOrganes entity)
		{
							yield return CreateParameter("PateintOrganesId",entity.PateintOrganesId);
							yield return CreateParameter("OrganesName",entity.OrganesName);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("PateintOrganesId",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_PatientOrganes_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_PatientOrganes_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_PatientOrganes_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_PatientOrganes_Select";}
		}
		}
		#endregion
	
	#region [ RadiologyDeviceRepository ]
	/// <summary>
	/// Repository for CRUD operations on RadiologyDevice table 
	/// </summary>
	public class RadiologyDeviceRepository : RepositoryBase< RadiologyDevice,RadiologyDeviceIdentity,RadiologyDeviceColumns >
	{
	 public RadiologyDeviceRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(RadiologyDevice entity)
		{
							yield return CreateParameter("DeviceCode",entity.DeviceCode);
								yield return CreateParameter("DeviceName",entity.DeviceName);
								yield return CreateParameter("Description",entity.Description);
								yield return CreateParameter("Dep_id",entity.Dep_id);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(RadiologyDevice entity)
		{
							yield return CreateParameter("DeviceCode",entity.DeviceCode);
							yield return CreateParameter("DeviceName",entity.DeviceName);
							yield return CreateParameter("Description",entity.Description);
							yield return CreateParameter("Dep_id",entity.Dep_id);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(RadiologyDeviceIdentity identity)
		{
					
				yield return CreateParameter("DeviceCode",identity.DeviceCode);
					}
        protected override string InsertProc
        {
            get { return "SP_RadiologyDevice_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_RadiologyDevice_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_RadiologyDevice_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_RadiologyDevice_Select";}
		}
		}
		#endregion
	
	#region [ RadiologyTypeRepository ]
	/// <summary>
	/// Repository for CRUD operations on RadiologyType table 
	/// </summary>
	public class RadiologyTypeRepository : RepositoryBase< RadiologyType,RadiologyTypeIdentity,RadiologyTypeColumns >
	{
	 public RadiologyTypeRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(RadiologyType entity)
		{
							yield return CreateParameter("RadiologyCode",entity.RadiologyCode);
								yield return CreateParameter("Description",entity.Description);
								yield return CreateParameter("Price",entity.Price);
								yield return CreateParameter("PatientGander",entity.PatientGander);
								yield return CreateParameter("PatientOrgansId",entity.PatientOrgansId);
								yield return CreateParameter("DeviceCode",entity.DeviceCode);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(RadiologyType entity)
		{
							yield return CreateParameter("RadiologyCode",entity.RadiologyCode);
							yield return CreateParameter("Description",entity.Description);
							yield return CreateParameter("Price",entity.Price);
							yield return CreateParameter("PatientGander",entity.PatientGander);
							yield return CreateParameter("PatientOrgansId",entity.PatientOrgansId);
							yield return CreateParameter("DeviceCode",entity.DeviceCode);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(RadiologyTypeIdentity identity)
		{
					
				yield return CreateParameter("RadiologyCode",identity.RadiologyCode);
					}
        protected override string InsertProc
        {
            get { return "SP_RadiologyType_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_RadiologyType_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_RadiologyType_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_RadiologyType_Select";}
		}
		}
		#endregion
	
	#region [ RadiologyRequestRepository ]
	/// <summary>
	/// Repository for CRUD operations on RadiologyRequest table 
	/// </summary>
	public class RadiologyRequestRepository : RepositoryBase< RadiologyRequest,System.Int32,RadiologyRequestColumns >
	{
	 public RadiologyRequestRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(RadiologyRequest entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("RequestDate",entity.RequestDate);
								yield return CreateParameter("ReservationDate",entity.ReservationDate);
								yield return CreateParameter("PatientPay",entity.PatientPay);
								yield return CreateParameter("PayResetNum",entity.PayResetNum);
								yield return CreateParameter("PatientSituation",entity.PatientSituation);
								yield return CreateParameter("RequestStatues",entity.RequestStatues);
								yield return CreateParameter("RadiologyCode",entity.RadiologyCode);
								yield return CreateParameter("PatientID",entity.PatientID);
								yield return CreateParameter("ReceptionEmpID",entity.ReceptionEmpID);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(RadiologyRequest entity)
		{
							yield return CreateParameter("RequestId",entity.RequestId);
							yield return CreateParameter("RequestDate",entity.RequestDate);
							yield return CreateParameter("ReservationDate",entity.ReservationDate);
							yield return CreateParameter("PatientPay",entity.PatientPay);
							yield return CreateParameter("PayResetNum",entity.PayResetNum);
							yield return CreateParameter("PatientSituation",entity.PatientSituation);
							yield return CreateParameter("RequestStatues",entity.RequestStatues);
							yield return CreateParameter("RadiologyCode",entity.RadiologyCode);
							yield return CreateParameter("PatientID",entity.PatientID);
							yield return CreateParameter("ReceptionEmpID",entity.ReceptionEmpID);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("RequestId",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_RadiologyRequest_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_RadiologyRequest_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_RadiologyRequest_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_RadiologyRequest_Select";}
		}
		}
		#endregion
	
	#region [ RadiologyImageRepository ]
	/// <summary>
	/// Repository for CRUD operations on RadiologyImage table 
	/// </summary>
	public class RadiologyImageRepository : RepositoryBase< RadiologyImage,System.Int32,RadiologyImageColumns >
	{
	 public RadiologyImageRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(RadiologyImage entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("RequestId",entity.RequestId);
								yield return CreateParameter("ImagePath",entity.ImagePath);
								yield return CreateParameter("ImageDate",entity.ImageDate);
								yield return CreateParameter("EmpID",entity.EmpID);
								yield return CreateParameter("Histogram",entity.Histogram);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(RadiologyImage entity)
		{
							yield return CreateParameter("ImageID",entity.ImageID);
							yield return CreateParameter("RequestId",entity.RequestId);
							yield return CreateParameter("ImagePath",entity.ImagePath);
							yield return CreateParameter("ImageDate",entity.ImageDate);
							yield return CreateParameter("EmpID",entity.EmpID);
							yield return CreateParameter("Histogram",entity.Histogram);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("ImageID",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_RadiologyImage_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_RadiologyImage_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_RadiologyImage_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_RadiologyImage_Select";}
		}
		}
		#endregion
	
	#region [ TechnicianDeviceRepository ]
	/// <summary>
	/// Repository for CRUD operations on TechnicianDevice table 
	/// </summary>
	public class TechnicianDeviceRepository : RepositoryBase< TechnicianDevice,TechnicianDeviceIdentity,TechnicianDeviceColumns >
	{
	 public TechnicianDeviceRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(TechnicianDevice entity)
		{
							yield return CreateParameter("TechnicianID",entity.TechnicianID);
								yield return CreateParameter("DeviceCode",entity.DeviceCode);
								yield return CreateParameter("StratWorkingDate",entity.StratWorkingDate);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(TechnicianDevice entity)
		{
							yield return CreateParameter("TechnicianID",entity.TechnicianID);
							yield return CreateParameter("DeviceCode",entity.DeviceCode);
							yield return CreateParameter("StratWorkingDate",entity.StratWorkingDate);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(TechnicianDeviceIdentity identity)
		{
					
				yield return CreateParameter("TechnicianID",identity.TechnicianID);
				
				yield return CreateParameter("DeviceCode",identity.DeviceCode);
					}
        protected override string InsertProc
        {
            get { return "SP_TechnicianDevice_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_TechnicianDevice_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_TechnicianDevice_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_TechnicianDevice_Select";}
		}
		}
		#endregion
	
	#region [ RolesRepository ]
	/// <summary>
	/// Repository for CRUD operations on Roles table 
	/// </summary>
	public class RolesRepository : RepositoryBase< Roles,System.Int32,RolesColumns >
	{
	 public RolesRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(Roles entity)
		{
							yield return CreateParameter("RolesID",entity.RolesID);
								yield return CreateParameter("EmployeeID",entity.EmployeeID);
								yield return CreateParameter("Role",entity.Role);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(Roles entity)
		{
							yield return CreateParameter("RolesID",entity.RolesID);
							yield return CreateParameter("EmployeeID",entity.EmployeeID);
							yield return CreateParameter("Role",entity.Role);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("RolesID",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_Roles_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_Roles_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_Roles_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_Roles_Select";}
		}
		}
		#endregion
	
	#region [ RadiologyReportRepository ]
	/// <summary>
	/// Repository for CRUD operations on RadiologyReport table 
	/// </summary>
	public class RadiologyReportRepository : RepositoryBase< RadiologyReport,System.Int32,RadiologyReportColumns >
	{
	 public RadiologyReportRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(RadiologyReport entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("reportDate",entity.reportDate);
								yield return CreateParameter("report",entity.report);
								yield return CreateParameter("RequestID",entity.RequestID);
								yield return CreateParameter("DoctorID",entity.DoctorID);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(RadiologyReport entity)
		{
							yield return CreateParameter("ReportID",entity.ReportID);
							yield return CreateParameter("reportDate",entity.reportDate);
							yield return CreateParameter("report",entity.report);
							yield return CreateParameter("RequestID",entity.RequestID);
							yield return CreateParameter("DoctorID",entity.DoctorID);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("ReportID",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_RadiologyReport_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_RadiologyReport_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_RadiologyReport_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_RadiologyReport_Select";}
		}
		}
		#endregion
	
	#region [ DepartmentsRepository ]
	/// <summary>
	/// Repository for CRUD operations on Departments table 
	/// </summary>
	public class DepartmentsRepository : RepositoryBase< Departments,System.Int32,DepartmentsColumns >
	{
	 public DepartmentsRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(Departments entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("Name",entity.Name);
								yield return CreateParameter("MangerStartDate",entity.MangerStartDate);
								yield return CreateParameter("MangerID",entity.MangerID);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(Departments entity)
		{
							yield return CreateParameter("Dep_id",entity.Dep_id);
							yield return CreateParameter("Name",entity.Name);
							yield return CreateParameter("MangerStartDate",entity.MangerStartDate);
							yield return CreateParameter("MangerID",entity.MangerID);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("Dep_id",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_Departments_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_Departments_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_Departments_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_Departments_Select";}
		}
		}
		#endregion
	
	#region [ EmployeesRepository ]
	/// <summary>
	/// Repository for CRUD operations on Employees table 
	/// </summary>
	public class EmployeesRepository : RepositoryBase< Employees,System.Int32,EmployeesColumns >
	{
	 public EmployeesRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(Employees entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("FirstName",entity.FirstName);
								yield return CreateParameter("Mobile",entity.Mobile);
								yield return CreateParameter("Address",entity.Address);
								yield return CreateParameter("Email",entity.Email);
								yield return CreateParameter("gender",entity.gender);
								yield return CreateParameter("NameTitle",entity.NameTitle);
								yield return CreateParameter("Dep_id",entity.Dep_id);
								yield return CreateParameter("Username",entity.Username);
								yield return CreateParameter("IsActive",entity.IsActive);
								yield return CreateParameter("Password",entity.Password);
								yield return CreateParameter("FamilyName",entity.FamilyName);
								yield return CreateParameter("Phone",entity.Phone);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(Employees entity)
		{
							yield return CreateParameter("Employee_id",entity.Employee_id);
							yield return CreateParameter("FirstName",entity.FirstName);
							yield return CreateParameter("Mobile",entity.Mobile);
							yield return CreateParameter("Address",entity.Address);
							yield return CreateParameter("Email",entity.Email);
							yield return CreateParameter("gender",entity.gender);
							yield return CreateParameter("NameTitle",entity.NameTitle);
							yield return CreateParameter("Dep_id",entity.Dep_id);
							yield return CreateParameter("Username",entity.Username);
							yield return CreateParameter("IsActive",entity.IsActive);
							yield return CreateParameter("Password",entity.Password);
							yield return CreateParameter("FamilyName",entity.FamilyName);
							yield return CreateParameter("Phone",entity.Phone);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("Employee_id",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_Employees_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_Employees_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_Employees_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_Employees_Select";}
		}
		}
		#endregion
	
	#region [ PatientsRepository ]
	/// <summary>
	/// Repository for CRUD operations on Patients table 
	/// </summary>
	public class PatientsRepository : RepositoryBase< Patients,System.Int32,PatientsColumns >
	{
	 public PatientsRepository(string connectionStringName) : base(connectionStringName) { }
		protected override IEnumerable<System.Data.Common.DbParameter> GetInsertParameters(Patients entity)
		{
								yield return CreateParameter("Identity",0,ParameterDirection.ReturnValue);
								yield return CreateParameter("FirstName",entity.FirstName);
								yield return CreateParameter("Gender",entity.Gender);
								yield return CreateParameter("Birthday",entity.Birthday);
								yield return CreateParameter("Nationality",entity.Nationality);
								yield return CreateParameter("Phone",entity.Phone);
								yield return CreateParameter("Mobile",entity.Mobile);
								yield return CreateParameter("Address",entity.Address);
								yield return CreateParameter("ContractID",entity.ContractID);
								yield return CreateParameter("FamilyName",entity.FamilyName);
						}
		protected override IEnumerable<System.Data.Common.DbParameter> GetUpdateParameters(Patients entity)
		{
							yield return CreateParameter("PatientID",entity.PatientID);
							yield return CreateParameter("FirstName",entity.FirstName);
							yield return CreateParameter("Gender",entity.Gender);
							yield return CreateParameter("Birthday",entity.Birthday);
							yield return CreateParameter("Nationality",entity.Nationality);
							yield return CreateParameter("Phone",entity.Phone);
							yield return CreateParameter("Mobile",entity.Mobile);
							yield return CreateParameter("Address",entity.Address);
							yield return CreateParameter("ContractID",entity.ContractID);
							yield return CreateParameter("FamilyName",entity.FamilyName);
					}
		protected override IEnumerable<System.Data.Common.DbParameter> GetDeleteParameters(System.Int32 identity)
		{
								yield return CreateParameter("PatientID",identity);
					}
        protected override string InsertProc
        {
            get { return "SP_Patients_Insert";}
		}
		
		protected override string UpdateProc
        {
            get { return "SP_Patients_Update";}
		}
		
		protected override string DeleteProc
        {
            get { return "SP_Patients_Delete";}
		}
		
		protected override string SelectProc
        {
            get { return "SP_Patients_Select";}
		}
		}
		#endregion
}
